package cn.zahuo.SJR.jdbc;
import cn.zahuo.SJR.jdbc.JDBC_tools.Jdbc_tools;
import java.sql.*;
@SuppressWarnings("ALL")
public class JDBC_tools_Test {
    public static void main(String[] args) {
        Connection connection=null;
        Statement stmt=null;
        ResultSet rs=null;
        Jdbc_tools tools= new Jdbc_tools();
        try {
            connection=tools.getConnection();
            stmt=tools.getConnection().createStatement();
            rs=stmt.executeQuery("select  * from emp");
            while (rs.next()) {
//                System.out.println(rs.getString("name")+"        "+rs.getInt("salary"));
                System.out.printf("%3s\t%.2f\n",rs.getString("name"),rs.getDouble("salary"));
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            Jdbc_tools.close(rs,stmt,connection);
        }
    }
}
